\def\fileversion{1.1}
\def\filedate{1994/04/14}

\NeedsTeXFormat{LaTeX2e}[1994/02/03]

\ProvidesPackage{compverb}[\filedate]

\RequirePackage{verbatim}

\newbox\compverbbox

\begingroup
 \catcode`\`=\active
 \gdef\verbatim@compfont{\tt \catcode96\active
   \def`{\kern\z@\char96 }}
\endgroup

\def\myspecialverbatimpreset{%
	\def\@verbatim{\the\every@verbatim
	  \leftskip=\@totalleftmargin
	  \rightskip=\z@
	  \parindent=\z@
	  \parfillskip=\@flushglue
	  \parskip=\z@
	  \@@par
	  \def\par{\@@par}%
	  \obeylines
	  \verbatim@compfont
	  \let\do\@makeother \dospecials}%
	\def\@xobeysp{\penalty\@M\ }%
	\let\endverbatim=\relax
	\let\myslash/%
}

\begingroup
\catcode`\/=\active
\gdef\myspecialverbatimsetup{%
   	\catcode`\/=\active
	\def/##1/{\def\TEST{##1}%
		\ifx\TEST\empty
			\myslash
		\else
			{\fontfamily{\rmdefault}\textit{##1}}%
		\fi}%
	\def\verbatim@processline{\hbox{\strut\the\verbatim@line}}%
	}%
\endgroup

\newenvironment{compverbatim}%
  {\par
   \setbox\compverbbox\vbox\bgroup
   \myspecialverbatimpreset
   \verbatim\myspecialverbatimsetup}%
  {\endverbatim\egroup
   \begin{flushleft}
   \fboxrule=\compverbrule
   \compverbtypeset{\box\compverbbox}
   \end{flushleft}}

\newenvironment{compverbatim*}%
  {\par
   \setbox\compverbbox\vbox\bgroup
   \myspecialverbatimpreset
   \verbatim\myspecialverbatimsetup}%
  {\endverbatim\egroup
   \begin{flushleft}
   \fboxrule=\compverbrulestar
   \compverbtypeset{\box\compverbbox}
   \end{flushleft}}
   
\def\compverbrule{\fboxrule}
\def\compverbrulestar{3\fboxrule}
\def\compverbtypeset#1{\fbox{#1}}

\endinput
